<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateNdBusinessExpensesTable extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('nd_business_expenses', function(Blueprint $table) {
            //$table->increments('id');
            $table->increments('id');                                   // ID
            $table->integer('ymd');                                     // 発生日
            $table->integer('userid');                                  // ユーザID
            $table->integer('domainid');                                // ドメインID
            $table->integer('accountcd')->nullable();                   // 勘定科目
            $table->integer('amount');                                  // 金額
            $table->integer('amount_tax')->nullable();                  // 消費税
            $table->string('summary', 40);                              // 摘要
            $table->text('memo', 120)->nullable();                      // 備考
            $table->integer('status')->default(0);                      // 0:未着、1:差戻、8:承認、9:完了
            $table->integer('status_ymd');                              // 変更日
            $table->integer('pay_ymd');                                 // 支払日
            $table->timestamps();
            //$table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('nd_business_expenses');
    }
}
